package com.xj.listener;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @version 1.0
 * @program: demo2
 * @packageName: com.xj.listener
 * @className XjConsumerListener
 * @description: TODO
 * @author: xj
 * @create: 2021-01-11 15:15:26
 **/

@Component
@RocketMQMessageListener(topic = "xiongjie-topic", consumerGroup = "xiongjie")
public class XjConsumerListener implements RocketMQListener<String> {

    @Override
    public void onMessage(String s) {
        //注意这里要进行幂等消费
        System.out.println("消息体为:"+s);
    }
}
